<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" href="/css/panel.css" />
  <link rel="stylesheet" href="/css/common.css" />
  <link rel="stylesheet" href="/cupertino/jquery.css" />
  <link rel="stylesheet" href="/cupertino/jquery.alerts.css" />
  <link rel="stylesheet" href="/css/jquery.autocomplete.css" />

  <script type="text/javascript" src="/js/jquery.js"></script>
  <script type="text/javascript" src="/js/jquery-ui.js"></script>
  <script type="text/javascript" src="/js/jquery.alerts.js"></script>
  <script type="text/javascript" src="/js/jquery.autocomplete.js"></script>
  <script type="text/javascript" src="/js/ajaxfileupload.js"></script>
  <title>Control Panel</title>
</head>
<body id="panel">

  <div id="header">
    <a href="/"><?=Config::get('site.title') ?></a>
  </div>

   
  <div id="main">
    <div id="tree">
      <div>
        <a href="/panel/editor/?act=children">Content</a>
        <a href="/panel/editor/" class="b">+</a>
      <?php
    function print_children( $tree, $id=0 ) {
      foreach ( $tree as $branch ): if ( $branch['parent'] == $id ): ?>
      <div>
        <a href="/panel/editor/<?=$branch['id'] ?>/"><?=$branch['title'] ?></a>
        <a href="/panel/editor/?to=<?=$branch['id'] ?>" class="b">+</a>
        <?php print_children( $tree, $branch['id'] ); ?>
      </div>
      <?php endif; endforeach;
    }
    print_children( $tree ); ?>
    
      </div>
        <div><a href="/panel/mods/">Modules</a></div>
        <div><a href="/panel/files/">Uploaded files</a></div>
        <div><a href="/panel/config/">Configuration</a></div>
    </div>

    <div id="page">
      <div class="tabs">
      <?php if(isset($tabs)) foreach( $tabs as $tab ): ?>      	<a class="tab" href="?act=<?=$tab['link'] ?>"><?=$tab['caption'] ?></a>
      <?php endforeach; ?>
      	<div class="clr"></div>      </div>
      <?=$content ?>
    </div>
    <div class="content_end"></div>
  </div>

</body>
</html>
<!--
<?php print_r(db::$log); ?>
 -->